package com.hxgz.steel.dao;

import com.hxgz.steel.dto.ExtendGoodDto;
import com.hxgz.steel.dto.GoodsTimeDto;
import com.hxgz.steel.domain.Product;
import com.hxgz.steel.domain.ProductWithBLOBs;
import com.hxgz.steel.dto.GoodDto;
import com.hxgz.steel.dto.HomeProductDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component("ProductMapper")
public interface ProductMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ProductWithBLOBs record);

    int insertSelective(ProductWithBLOBs record);

    Product selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ProductWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(ProductWithBLOBs record);

    int updateByPrimaryKey(Product record);

    List<Product> selectByIdAndName(HashMap<Object, Object> mapTime);

    List<ExtendGoodDto> listProducts(GoodDto dto);

    int insertProduct(Product product);

    ProductWithBLOBs getProductById(Long id);

    int updateStatusByUserIdAndId(Product product);

    List<HomeProductDto> productListList(Map map);

    List<Product> hotProduct();

    List<HomeProductDto> storeProdectList(Long merchantId);

    int updateProduct(Product product);

    List<GoodsTimeDto> checkGoods(HashMap<Object, Object> map);

    Product getProductAndPriceById(Long id);

    List<HomeProductDto> searchProductList(Map map);

    Integer getProductSales(Long productId);

    Integer getProductCountByMerchantId(@Param("merchantId") Long merchantId);

    String getSubImagesById(Long id);

    Long getUserIdByProductId(@Param("productId") Long productId);
}